//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2008 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : FileReader.h
//----------------------------------------------------------------------------

#ifndef FILEREADER_H
#define FILEREADER_H

#include <string>
#include <vector>
#include "defines.h"

/// reader for parameter files for wave testing
class FileReader
{
public:

    FileReader(const char *name);

    virtual ~FileReader();

    std::string getFileName() const;

    bool Eof();

    int ReadInt();

    REAL ReadFloat();

    bool ReadBoolean();

    void ReadLine(REAL *a, REAL *b, REAL *c, bool *d);

    std::string ReadString();

    std::string ReadSection();

    void ReadFloats(REAL *a, REAL *b);

    void ReadFloats(REAL *a, REAL *b, REAL *c, REAL *d);

private:

    // should never be called
    FileReader(const FileReader&);
    FileReader & operator=(const FileReader&);

    void ReadCompleteLine(char *line);

    FILE *m_fp; ///< file pointer
    std::string m_filename; ///< file name
};

#endif // FILEREADER_H
